package com.lx.pc.mybatis.repository.transaction;

import java.math.BigInteger;
import java.util.List;

import org.springframework.data.mybatis.repository.annotation.Query;
import org.springframework.data.mybatis.repository.support.MybatisRepository;
import org.springframework.stereotype.Repository;

import com.lx.pc.domain.entity.transaction.TransactionEntity;
import com.lx.pc.domain.vo.transaction.TransactionVo;

@Repository("transactionRepository")
public interface TransactionRepository extends MybatisRepository<TransactionEntity, BigInteger>{

	/**
	 * 查询总数
	 */
	@Query("findByTransactionCount")
	public int findByTransactionCount(TransactionEntity transaction);
	
	/**
	 * 查询方法
	 * @param page
	 * @param size
	 * @return
	 */
	@Query("findByTransaction")
	public List<TransactionEntity> findByTransaction(TransactionEntity transaction,Integer page,Integer size);
	
	/**
	 * 收入-支出
	 * @param transaction
	 * @return
	 */
	@Query("findByTransactionIncomeCount")
	public Float findByTransactionIncomeCount(TransactionEntity transaction);
	
	/**
	 * 支出
	 * @param transaction
	 * @return
	 */
	@Query("findByTransactionExpenditureCount")
	public Float findByTransactionExpenditureCount(TransactionVo transaction);
}
